<div class="maintable">
	<table class="grid" width="600">
		<caption>Trees in Storage</caption>
		<thead>
			<tr>
				<th width="60">Image</th>
				<th>Name</th>
				<th>Mastery</th>
				<th>Release</th>
				<th>Coins</th>
				<th>Cocos</th>
				<th>Jade</th>
				<th>Count</th>
				<th>Action</th>
			</tr>
		</thead>
		<tbody>
<?php
$vAllTrees = AFT_MakeTreeDB('st');	
foreach ($vAllTrees as $vATr) {
	if ($vATr['cntST']>0) {
		$class = $vATr['mastery'] >= 1?"mastered":"";
		echo "<tr class=\"$class\">";
		echo AFT_tr($vATr,array('icon','name','mastery','release','coins','cocos','jade'));
?>
					<td><?=$vATr['cntST']?></td>
					<td>
					<table border="0" cellpadding="0" cellspacing="0">
						<tbody>
							<tr>
								<td>Action</td>
								<td>
									<select name="tree-<?=urlencode($vATr['code'])?>-actionST" size="1" class="saveConf">
										<option value="select"<?=$vATr['actionST']=='select' ? ' selected':''?>>&nbsp;</option>
										<option value="store"<?=$vATr['actionST']=='store' ? ' selected':''?>>Store</option>
										<option value="sell"<?=$vATr['actionST']=='sell' ? ' selected':''?>>Sell</option>
										<option value="place"<?=$vATr['actionST']=='place' ? ' selected':''?>>Place</option>
									</select>
								</td>
							</tr>
							<tr>
								<td>Keep</td>
								<td>
									<input name="tree-<?=urlencode($vATr['code'])?>-actionSTcnt" size="3" type="text" value="<?=$vATr['actionSTcnt']?>" class="saveConf">
								</td>
							</tr>
						</tbody>
					</table>
				</td>
			</tr>
<?php
	}
}
?>
		</tbody>
	</table>
	
	<?php 
/*	$store_list        = @unserialize(file_get_contents(F('instorage.txt')));
	foreach ($store_list as $code => $num) {
	echo "code = $code ";
		echo Units_GetNameByCode($code);
	}
	print_r($store_list);
	$vTrees = Units_GetByType("tree", true);
	print_r($vTrees);
*/	
	?>
	
	
</div>
<div class="settings">
	<input type="button" value="Clear All Actions" onclick="actionconf('faction=general&actn=clearallst')"><br>
	<input type="button" value="Place All Trees" onclick="actionconf('faction=general&actn=placeallst')"><br>
	<input type="button" value="Sell All Trees" onclick="actionconf('faction=general&actn=sellallst')"><br>
</div>